addLoadEvent(function() {
    document.getElementById('myForm:myProfileImage').onclick = function () {
        ImageMenu.showPopUp();
    };
    }
);  


var ImageMenu = { 
    showPopUp:function() {

        var contentsLeft = document.getElementById('contents').offsetLeft;
        var contentsTop = document.getElementById('contents').offsetTop;  
        var contentsWidth = document.getElementById('contents').offsetWidth;
        var contentsHeight = document.getElementById('contents').offsetHeight;
    
        $("#imageDialog").css({ 
            "visibility": "visible",
            "height": 0,
            "width" : contentsWidth,
            "top": contentsTop,  
            "left": contentsLeft
        }).animate({
            height:  contentsHeight
        }, 'slow');}
    };
